﻿/***************************************************************************************************************
**
**	CheckComboBox head file
**
**	
**
*****************************************************************************************************************/

#ifndef CHECKCOMBOBOX_H
#define CHECKCOMBOBOX_H

#include <QtGui>


class CheckComboBox : public QComboBox
{
	Q_OBJECT

public:
	CheckComboBox( QWidget * parent = 0 , bool bHaveSelectAll=false);
	~CheckComboBox();

	int addItem(QString text, bool bCheck=false);
	int addItemText(const QString &text, const QVariant &userData = QVariant(), bool bCheck=false);
	
	void setCheck(int nIndex, bool bCheck);

	void SelectAll(bool bCheck);
	
	bool isChecked(int nIndex);

	void getSelStringList(QStringList &stSelectedList);

	QString getSelString();

public slots:
	void _itemCB(const QModelIndex &);
	void _editTextChanged();

private:
	QMap<int, QString> _mapSelString;
	bool _bHaveSelectAll;
};

#endif
